namespace PDUConverter
{
    /// <summary>
    /// General Data Coding indication
    /// </summary>
    public class GeneralDataCoding : DataCodingScheme
    {
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <param name="dcs">The DCS byte to decode.</param>
        public GeneralDataCoding(byte dcs) : base(dcs)
        {
            Compressed = (dcs & 0x20) > 0;
            ClassSpecified = (dcs & 0x10) > 0;
            Alphabet = (byte) ((dcs >> 2) & 3);
            MessageClass = (byte) (dcs & 3);
        }

        /// <summary>
        /// Gets the alphabet being used.
        /// </summary>
        public byte Alphabet { get; private set; }

        /// <summary>
        /// Determines if the GeneralDataCoding.MessageClass property has a message class meaning. If not,
        /// the GeneralDataCoding.MessageClass property contains a reserved value and has no message class meaning.
        /// </summary>
        public bool ClassSpecified { get; private set; }

        /// <summary>
        /// Gets whether the text is compressed.
        /// </summary>
        public bool Compressed { get; private set; }

        /// <summary>
        /// Gets the message class.
        /// </summary>
        public byte MessageClass { get; private set; }
    }
}